package com.cc.dao;

import com.mysql.cj.util.StringUtils;
import lombok.Data;

import java.util.HashMap;
import java.util.List;

/**
 * @User c.c
 * @Since 2022/8/11
 * @Time 10:07
 * @Description 数据库缓存字段（包含了选定的库，这个库下面所有表的结构数据）
 */
@Data
public class LibaryProperties extends HashMap<String,List<TableStruct>> {

  private String tableName;
  private String tableComment;
  private List<TableStruct> tableStructs;

  @Override
  public List<TableStruct> put(String tableName, List<TableStruct> tableStructs) {
    this.tableName = tableName;
    this.tableStructs = tableStructs;
    return super.put(tableName, tableStructs);
  }

  public List<TableStruct> put(String tableName, List<TableStruct> tableStructs,String tableComment) {
    if (tableComment==null){
      return super.put(tableName, tableStructs);
    }
    tableName = tableName+"|"+tableComment;
    return put(tableName,tableStructs);
  }
}
